program TwoCircles;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a1, b1, c1, a2, b2, c2, x1, y1, x0, y0, r, y, x, R1, R2 : real;
begin
  writeln('r1(the biggest)=');
  readln(r1);

  writeln('r2(the smallest)=');
  readln(r2);

  writeln('x0, y0 =');
  readln(x0, y0);

  writeln('x1, y1 =');
  readln(x1, y1);

  R1 := (r1 + r2);


  x := x0 - x1;
  y := y0 - y1;
  a1 := (-x*r - y*Sqrt(x*x + y*y- R1*R1)) / (x*x + y*y);
  b1 := (-y*r + x*Sqrt(x*x + y*y- R1*R1)) / (x*x + y*y);
  c1 := -a1*x0 - b1*y0 ;

  writeln(a1:0:2,'*x+(',b1:0:2,')*y+(',c1:0:2,')=0');

  a1 := ((-1)*x*r + y*(sqrt(x*x + y*y - R1*R1))) / (x*x + y*y);
  b1 := ((-1)*y*r - x*(sqrt(x*x + y*y - R1*R1))) / (x*x + y*y);
  c2 := (-1)*a2*x0 - b2*y0 ;

  writeln(a2:0:2,'*x+(',b2:0:2,')*y+(',c2:0:2,')=0');
                                                             
  R2 := (r1 - r2);
  x := x0 - x1;
  y := y0 - y1;
  a1 := (-x*r - y*Sqrt(x*x + y*y- R2*R2)) / (x*x + y*y);
  b1 := (-y*r + x*Sqrt(x*x + y*y- R2*R2)) / (x*x + y*y);
  c1 := -a1*x0 - b1*y0 ;

  writeln(a1:0:2,'*x+(',b1:0:2,')*y+(',c1:0:2,')=0');

  a1 := ((-1)*x*r + y*(sqrt(x*x + y*y - R2*R2))) / (x*x + y*y);
  b1 := ((-1)*y*r - x*(sqrt(x*x + y*y - R2*R2))) / (x*x + y*y);
  c2 := (-1)*a2*x0 - b2*y0 ;

  writeln(a2:0:2,'*x+(',b2:0:2,')*y+(',c2:0:2,')=0');
  readln;
end.
 